﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Automapping;
using FluentNHibernate.Automapping.Alterations;
using Peak.Core;

namespace Peak.Data.NHibernateMaps
{
  public class TokenMap : IAutoMappingOverride<Token>
  {
    public void Override(AutoMapping<Token> mapping)
    {
      mapping.Id(x => x.Id, "id").UnsavedValue(0).GeneratedBy.Identity();      
      mapping.Map(x => x.TokenId).Not.Nullable();
      mapping.Map(x => x.ValidDate).Not.Nullable();
      mapping.Map(x => x.Created).Not.Nullable();      
    }
  }
}